"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.encodeBase64 = exports.decodeBase64 = void 0;
var _encUtf = _interopRequireDefault(require("crypto-js/enc-utf8"));
var _encBase = _interopRequireDefault(require("crypto-js/enc-base64"));
/**
 * base64 编码
 * @param utf8Str
 * @returns
 */
const encodeBase64 = utf8Str => {
  const wordArray = _encUtf.default.parse(utf8Str);
  return _encBase.default.stringify(wordArray);
};

/**
 * base64 解码
 * @param base64Str
 * @returns
 */
exports.encodeBase64 = encodeBase64;
const decodeBase64 = base64Str => {
  const wordArray = _encBase.default.parse(base64Str);
  return _encUtf.default.stringify(wordArray);
};
exports.decodeBase64 = decodeBase64;